//处理登录功能

var loginHtml = {};

loginHtml.loginForm_submit = function() {
	var params = {};
	params["userName"] = $("#userName").val();
	params["password"] = $("#password").val();
	$.ajax({
		type:"post",
		dataType:'json',
		contentType : "application/json",
		url : pageContext["webRootPath"] + '/auth/login.do',
		data : JSON.stringify(params),
		success : function(data) {
			if(data["status"]>0){
				window.location.href=pageContext["webRootPath"]+pageContext["webViewRoot"]+"/base/index/index.html";
			}else{
				loginHtml.loginForm_clear();
				$.messager.alert(pageContext.getMessage("pubic.message.warm"),data.message);  
			}
		}
	});
}

loginHtml.loginForm_clear = function() {
	$('#loginForm').form('clear');
}

$(document).ready(function() {

	// $("body").css({"text-align":"center"});
	//	
	// alert($(window).height());
	//	
	// $("#loginPanel").css({
	// "margin-top":$(window).height()/2,
	// "margin-left":$(window).width()/2
	// });

});

//function afterLoadLocaleMessages(){
//	alert("afterLoadLocaleMessages");
//}
